<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>审核流程-目的地运营集团数据管理平台</title>
<include file="Include:style" />
<link rel="stylesheet" href="__PUBLIC__/mobile/css/dropload.css">
</head>
<body style="background: #f3f3f3;">
<div class="header" style="line-height:0">
	<a href="__APP__/Mobile/Index/index" class="back_btn"></a>
    <a <if condition="$type eq 1">class="project_menu project_menu_l active"<else />class="project_menu project_menu_l"</if> href="__APP__/Mobile/Index/audit_list/state/{$state}/type/1/sh_type/{$sh_type}">待我审的</a><a <if condition="$type eq 2">class="project_menu project_menu_r active"<else />class="project_menu project_menu_r"</if> href="__APP__/Mobile/Index/audit_list/state/{$state}/type/2/sh_type/{$sh_type}">我已审的</a>
</div>
<div class="select_menu">
    <div class="classify clearboth">
        <a href="javascript:;"><span><if condition="$sh_type eq -10">全部分类<elseif condition="$sh_type eq 5" />任务管理<elseif condition="$sh_type eq 7" />人员需求</if></span></a><a href="javascript:;"><span><if condition="$state eq -10">全部状态<elseif condition="$state eq 1" />进行中<elseif condition="$state eq 2" />已完结</if></span></a>
    </div>
    <div class="btn_box">
        <ul>
            <li <if condition="$sh_type eq -10">class="active"</if>><a href="__APP__/Mobile/Index/audit_list/state/{$state}/type/{$type}/sh_type/-10">全部分类</a></li>
            <li <if condition="$sh_type eq 5">class="active"</if>><a href="__APP__/Mobile/Index/audit_list/state/{$state}/type/{$type}/sh_type/5">任务管理</a></li>
            <li <if condition="$sh_type eq 7">class="active"</if>><a href="__APP__/Mobile/Index/audit_list/state/{$state}/type/{$type}/sh_type/7">人员需求</a></li>
        </ul>
        <ul>
            <li <if condition="$state eq -10">class="active"</if>><a href="__APP__/Mobile/Index/audit_list/state/-10/type/{$type}/sh_type/{$sh_type}">全部状态</a></li>
            <li <if condition="$state eq 1">class="active"</if>><a href="__APP__/Mobile/Index/audit_list/state/1/type/{$type}/sh_type/{$sh_type}">进行中</a></li>
            <li <if condition="$state eq 2">class="active"</if>><a href="__APP__/Mobile/Index/audit_list/state/2/type/{$type}/sh_type/{$sh_type}">已完结</a></li>
        </ul>
    </div>
</div>
<div class="content">
    <div class="audit_list">
        <ul>
			<foreach name="result" item="vo">
				<li>
					<if condition="$vo['type'] eq 5">
						<a href="__APP__/Mobile/Project/task_detail/id/{$vo['audit_id']}/audit/sh">
					<elseif condition="$vo['type'] eq 7"/>
						<a href="__APP__/Mobile/Index/person_demand_detail/id/{$vo['audit_id']}/type/{$type}/audit/sh">
					</if>
					<div class="time">{$vo['order_number']}<span>|</span><if condition="$vo['type'] eq 1">协助申请<elseif condition="$vo['type'] eq 3"/>增员申请<elseif condition="$vo['type'] eq 4" />日程管理<elseif condition="$vo['type'] eq 5" />任务管理<elseif condition="$vo['type'] eq 6" />资料库审核<elseif condition="$vo['type'] eq 7" />人员需求</if><em><if condition="$vo['status'] eq -1">未提交<if condition="$vo['dh_uid'] neq NULL">(已打回)</if><else />{$vo['status_name']}</if></em></div>
					<div class="user"><span>申请人：{$vo['add_user']} ({$vo['add_date']|substr=0,10})</span>当前环节人员：<if condition="$vo['audit_user'] neq NULL">{$vo['audit_user']}<else />无</if></div>
					</a>
				</li>
			</foreach>
        </ul>
    </div>
</div>
<div class="Mask item_mask"></div>
<include file="Include:javascript" />
<script src="__PUBLIC__/mobile/js/dropload.min.js"></script>
<script>
$('.select_menu .classify a').each(function(i){
    var _this = $(this);
    _this.click(function(){
        if(_this.hasClass('active')){
            _this.removeClass('active');
            $('.select_menu ul').removeClass('active');
            $('.select_menu .btn_box').css('height','0');
            $('.item_mask').fadeOut();
        }else{
            var hei = $('.select_menu ul').eq(i).height()+20;
            _this.addClass('active').siblings().removeClass('active');
            $('.select_menu ul').eq(i).addClass('active').siblings().removeClass('active');
            $('.select_menu .btn_box').css('height',hei);
            $('.item_mask').fadeIn();
        }
    })
})

$('.item_mask').on('touchstart',function(){
    $('.select_menu .classify a,.select_menu ul').removeClass('active');
    $('.select_menu .btn_box').css('height','0');
    $('.item_mask').fadeOut();
})

    var center_id = "{$center_id}";
    $(".project_menu,.search_btn_box a,.search_list_box a,.back_btn").click(function(){sessionStorage.clear();});

    $(function(){
        var $now = 1;
        //输出本地存储now
        var $storage_now = sessionStorage.getItem("storage_now");
        if($storage_now){
            $now = parseInt($storage_now);
        }
        var page = 6,
            $count = "{$count}",
            max = Math.ceil(parseInt($count)/page);

        $('.content').dropload({
            scrollArea : window,
            loadDownFn : function(me){
                if($now<max){
                    var type = "{$type}",
						html = '',
						s_type = '',
						s_status = '',
						f_status = '',
                        $start_count = page*$now;
                    $.ajax({
                        type: 'POST',
                        async:false,
				        dataType:"json",
                        data:{"type":type,"start_size":$start_count,"start_page":page},
                        url:"__APP__/Mobile/Index/audit_list_show",
                        dataType: 'json',
                        success: function(data){
                            if(data){
                                for(var i=0; i<data.length; i++){
                                    html += '<li>';
									if(data[i].type ==5){
										html += '<a href="__APP__/Mobile/Project/task_detail/id/'+data[i].audit_id+'/audit/sh">';
									}else if(data[i].type ==7){
										html += '<a href="__APP__/Mobile/Index/person_demand_detail/id/'+data[i].audit_id+'/type/'+type+'/audit/sh"">';
									}
									if(data[i].type ==5){
										s_type='任务管理';
									}else if(data[i].type ==7){
										s_type='人员需求';
									}
									html += '<div class="time">'+data[i].order_number+'<span>|</span>'+s_type+'</div>';
									html += '<div class="name">'+data[i].add_user+'('+data[i].add_date.substring(0,10)+')</div>';
									html += '<div class="user">';
									if(data[i].status ==-1){
										s_status='未提交';
										if(data[i].status){
											s_status='(已打回)';
										}
									}else{
										s_status=data[i].status_name;
									}
									html += '<span>状态：'+s_status+'</span>当前环节人员：';
									if(data[i].audit_user !=''){
										f_status=data[i].audit_user;
									}else{
										f_status='无';
									}
									html += f_status+'</div>';
                                    html += '</a>';
                                    html += '</li>';
                                }
                            }
                            $now++;
                            //保存本地存储
                            var $get_str_after = sessionStorage.getItem("storage_str"),
                                $storage_str = "";

                            if($get_str_after){
                                $storage_str += $get_str_after.replace(/^\[|\]$/g,"")+",";
                            }
                            $storage_str += JSON.stringify(data).replace(/^\[|\]$/g,"");
                            $storage_str = "["+$storage_str+"]";
                            sessionStorage.setItem("storage_str",$storage_str);
                            sessionStorage.setItem("storage_now",$now);
                            $('.audit_list ul').append(html);
                            me.resetload();
                        },
                        error: function(xhr, type){
                            alert('Ajax error!');
                            // 即使加载出错，也得重置
                            me.resetload();
                        }
                    });
                }else{
                    me.lock();
                    me.noData();
                    me.resetload();
                }
            }
            
        });
        
    })
    $(window).scroll(function(){
        //保存滚动条位置
        var $storage_top = $(window).scrollTop();
        sessionStorage.setItem("storage_top",$storage_top);
    });
    $(function(){
        var $get_str_before = sessionStorage.getItem("storage_str"),
            $storage_top = sessionStorage.getItem("storage_top");

        if($get_str_before){
            var $data = JSON.parse($get_str_before),
				$type = "{$type}",
                $html = "",
				$s_type = '',
				$s_status = '',
				$f_status = '';
           
            for(var i=0;i<$data.length;i++){
                $html += '<li>';
				if($data[i].type ==5){
					$html += '<a href="__APP__/Mobile/Project/task_detail/id/'+$data[i].audit_id+'/audit/sh">';
				}else if($data[i].type ==7){
					$html += '<a href="__APP__/Mobile/Index/person_demand_detail/id/'+$data[i].audit_id+'/type/'+type+'/audit/sh"">';
				}
				if($data[i].type ==5){
					$s_type='任务管理';
				}else if($data[i].type ==7){
					$s_type='人员需求';
				}
				$html += '<div class="time">'+$data[i].order_number+'<span>|</span>'+$s_type+'</div>';
				$html += '<div class="name">'+$data[i].add_user+'('+$data[i].add_date.substring(0,10)+')</div>';
				$html += '<div class="user">';
				if($data[i].status ==-1){
					$s_status='未提交';
					if($data[i].status){
						$s_status='(已打回)';
					}
				}else{
					$s_status=$data[i].status_name;
				}
				$html += '<span>状态：'+$s_status+'</span>当前环节人员：';
				if($data[i].audit_user !=''){
					$f_status=$data[i].audit_user;
				}else{
					$f_status='无';
				}
				$html += $f_status+'</div>';
				$html += '</a>';
				$html += '</li>';
                $html += '</a>';
                $html += '</li>';
            }
            $('.audit_list ul').append($html);
        }

        if($storage_top){
            $(window).scrollTop($storage_top);
        }
    })
</script>
</body>
</html>